#include "useofvariable.h"
#include <iostream>
using namespace std;

UseOfVariable::UseOfVariable()
{

}

void UseOfVariable::show(){
    cout << "====================UseOfVariable show===========================" << endl;

    // 变量的定义
    int i, j; //会分配地址,定义，不赋初始值
    char c, ch;

    cout << "&i的地址：" << &i << "\t\t &j的地址：" << &j << "\t\t &c的地址: " << &c << "\t\t &ch的地址" << &ch << endl;

    c = 'X';
    cout << "c: " << c << "\t\t &c的地址: " << &c << endl;
    c = 123;
    cout << "c: " << c << "\t\t &c的地址: " << &c << endl;

    int x = 123; //定义直接赋值
    cout << "x: " << x << "\t\t &x的地址: " << &x << endl;
}
